﻿@using PicStore.Web.Lib
<!DOCTYPE html>
<html lang="zh">
    <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <meta charset="utf-8" />
        <title>@ViewBag.Title</title>
        <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Scripts.Render("~/bundles/modernizr")
        
        <link rel="Stylesheet" href="~/Css/bootstrap.css" />
        <link rel="Stylesheet" href="~/Css/datepicker.css" />
        <script src="~/Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="~/Scripts/bootstrap.min.js"></script>
        <script type="text/javascript" src="~/Scripts/bootstrap-datepicker.js"></script>

        <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
        <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
        <script src="~/Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript" ></script>
        <script src="~/Scripts/knockout-2.1.0.js" type="text/javascript"></script>
        <script src="~/Scripts/site.js" type="text/javascript"></script>
        
    </head>
    <body>
        <header>
            <div class="content-wrapper">
                <div class="float-left">
                    <p class="site-title"><img src="/Images/LOGO.jpg"/></p>
                </div>
                <div class="float-right">
                    <section id="login">
                        @Html.Partial("_LoginPartial")
                    </section>
                    <nav>
                        <ul id="menu">
                        @if (Request.IsAuthenticated)
                        {
                            if (ViewData["RoleName"] != null)
                            {
                                if (ViewData["RoleName"].ToString().ToLower() == PicStore.Model.RoleEnum.Admin.ToString().ToLower())
                                {
                                  <li>@Html.ActionLink("User Management", "Index", "User")</li>
                                  <li>@Html.ActionLink("Category Management", "Index", "Category")</li>
                                  <li>@Html.ActionLink("Report", "Index", "Report")</li> <br/>
                                  <li>@Html.ActionLink("Apply Management", "Index", "Apply")</li>
                                  <li>@Html.ActionLink("Picture Management", "Index", "Picture")</li>
                                }
                                else if (ViewData["RoleName"].ToString().ToLower() == PicStore.Model.RoleEnum.Manager.ToString().ToLower())
                                {
                                  <li>@Html.ActionLink("Apply Management", "Index", "Apply")</li>
                                  <li>@Html.ActionLink("Picture Management", "Index", "Picture")</li> 
                                  <li>@Html.ActionLink("Report", "Index", "Report")</li> 
                                }
                                else if (ViewData["RoleName"].ToString().ToLower() == PicStore.Model.RoleEnum.Viewer.ToString().ToLower())
                                {
                                  <li>@Html.ActionLink("Apply Management", "RequesterIndex", "Apply")</li>
                                }
                                else if (ViewData["RoleName"].ToString().ToLower() == PicStore.Model.RoleEnum.Contributer.ToString().ToLower())
                                {
                                  <li>@Html.ActionLink("Picture List", "Index", "Picture")</li>
                                }
                                else if (ViewData["RoleName"].ToString().ToLower() == PicStore.Model.RoleEnum.HighViewer.ToString().ToLower())
                              {
                                  <li>@Html.ActionLink("Apply Management", "RequesterIndex", "Apply")</li>
                                  <li>@Html.ActionLink("Picture Management", "Index", "Picture")</li> 
                              }
                            }
                        }
                        </ul>
                    </nav>
                </div>
            </div>
        </header>
        <div id="body">
            @RenderSection("featured", required: false)
            <section class="content-wrapper main-content clear-fix">
                @RenderBody()
            </section>
        </div>
        <footer>
            <div class="content-wrapper">
                <div class="float-left">
                    <p>&copy; @DateTime.Now.Year - Picture Management</p>
                </div>
            </div>
        </footer>

        @RenderSection("scripts", required: false)
    </body>
</html>
